package com.almm.web.service;

import com.alibaba.fastjson.JSONObject;
import com.almm.web.common.ResponseResult;
import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class ExceptService {

    @Getter
    private static final Logger log = LoggerFactory.getLogger(ExceptService.class);

    public ResponseResult<JSONObject> demo_01(){
        JSONObject result = new JSONObject();
        try {
            result.put("code", 1);
            result.put("message","成功11111");
            return ResponseResult.ok(result);
        }catch (Exception exception){
            log.error("demo_01方法异常:{}",exception.getMessage(),exception);
            throw exception;
        }
    }

    public ResponseResult<JSONObject> demo_02(){
        JSONObject error = new JSONObject();
        try {
            error.put("code", 1);
            error.put("message","成功");
            return ResponseResult.ok(error);
        }catch (Exception exception){
            log.error("demo_01方法异常:{}",exception.getMessage(),exception);
            throw exception;
        }
    }




}
